﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace TPG.SharePoint.Workflow
{
    internal class StaticPropertyDescriptor : PropertyDescriptor
    {
        private Type _type;

        public StaticPropertyDescriptor(string name, Type type)
            : base(name, null)
        {
            _type = type;
        }

        public override bool CanResetValue(object component)
        {
            return false;
        }

        public override Type ComponentType
        {
            get { return typeof(TaskData); }
        }

        public override object GetValue(object component)
        {
            return component.GetType().GetProperty(base.Name).GetValue(component, null);
        }

        public override bool IsReadOnly
        {
            get { return true; }
        }

        public override Type PropertyType
        {
            get { return _type; }
        }

        public override void ResetValue(object component)
        {
            throw new NotImplementedException();
        }

        public override void SetValue(object component, object value)
        {
            throw new NotImplementedException();
        }

        public override bool ShouldSerializeValue(object component)
        {
            return false;
        }
    }

}
